package com.simple.editor.action;

import com.simple.editor.callback.Callback;
import com.simple.editor.ui.FileModel;

/**
 * {@link EditorUIAction} defines interface for user action handling.
 * <p/>
 * Created with IntelliJ IDEA.
 * User: vlad
 * Date: 6/2/13
 * Time: 4:19 PM
 * To change this template use File | Settings | File Templates.
 */
public interface EditorUIAction {

    /**
     * Handle UI action
     *
     * @param files files parameter
     * @throws EditorException indicates handling error
     */
    void perform(FileModel... files) throws EditorException;

    /**
     * Handle UI action
     *
     * @param files files parameter
     * @throws EditorException indicates handling error
     */
    void perform(Callback callback, FileModel... files) throws EditorException;

    /**
     * Represents an action type.
     */
    enum Type {
        /**
         * Represents an "open project" action.
         */
        OPEN_PROJECT,
        /**
         * Represents an "refresh" action.
         */
        REFRESH,
        /**
         * Represents an "update" action.
         */
        UPDATE,
        /**
         * Represents a "commit" action.
         */
        COMMIT,
        /**
         * Represents a "open file" action.
         */
        OPEN,
        /**
         * Represents a "close file" action.
         */
        CLOSE,
        /**
         * Represents a "delete file" action.
         */
        DELETE,
        /**
         * Represents a "revert file" action.
         */
        REVERT,
        /**
         * Represents a "save file" action.
         */
        SAVE,
        /**
         * Represents a notification about local file modifications.
         */
        MODIFY
    }
}
